<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./lib/vue-2.4.0.js"></script>
</head>
<body>
     <div id="app">
         <input type="button" value="浪起来" @click="lang">
         <input type="button" value="别浪" @click="nolang">
         <h4>{{msg}}</h4>

     </div>
</body>
<script>
    const vm=new Vue({
        el:"#app",
        data:{
            msg:"猥琐发育，别浪~",
            timer:null
        },
        methods:{
            lang:function(){
                if (this.timer){
                   return;
                }

                this.timer=setInterval(()=>{
                    var start=this.msg.substring(0,2);
                    var end=this.msg.substring(2);
                    this.msg=end+start;
                },500)

            },
            nolang(){
                clearInterval(this.timer);
                this.timer=null;
            }
        }

    })
</script>
</html>